<?php
function gzdsx_pos_ajax_query_product()
{
    $products = wc_get_products([
        'numberposts' => 20
    ]);

    wp_send_json_success($products);
}

add_action('wp_ajax_gzdsx-pos-query-product', 'gzdsx_pos_ajax_query_product');